import App from "../App";
import Home from "../pages/home";
import Xiaoxi from "../pages/xiaoxi";
import Me from "../pages/me";
import Login from "../pages/login";
import List from "../pages/list";
import City from "../pages/city";
import Deail from "../pages/deail";
import Error from "../pages/error";
import { createBrowserRouter } from 'react-router-dom'

export const router = createBrowserRouter([
    {
        path: "/",
        element: <App></App>,
        children: [
            {
                index: true,
                element: <Home></Home>
            },
            {
                path: "home",
                element: <Home></Home>
            },
            {
                path: "xiaoxi",
                element: <Xiaoxi></Xiaoxi>
            },
            {
                path: "me",
                element: <Me></Me>
            },
        ]
    },
    {
        path: "/login",
        element: <Login></Login>
    },
    {
        path: "/list",
        element: <List></List>
    },
    {
        path: "/city",
        element: <City></City>
    },
    {
        path: "/deail/:id",
        element: <Deail></Deail>
    },
    {
        path: "*",
        element: <Error></Error>
    },
]);